"""
项目：Ai-Engineer自适应工程设计自动化插件
作者：刘昊轩、李佳音、刘伟伟、杨明久（排序不分先后）
©版权保护
"""
# main.py
import logging
from ai_integration.fallback_client import FallbackAIClient
from ui.comment_ui import CommentUI

# 配置日志
logging.basicConfig(
    level=logging.INFO,
    format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
    handlers=[
        logging.FileHandler("log/cad_assistant.log"),
        logging.StreamHandler()
    ]
)
logger = logging.getLogger("Main")

if __name__ == "__main__":
    try:
        ai = FallbackAIClient()
        comment_ui = CommentUI(ai)
        comment_ui.interactive_loop()

    except Exception as e:
        logger.critical("系统致命错误：%s", str(e))
        print("程序因严重错误终止，请查看日志文件cad_assistant.log")